<template>
  <view>
    <biaotou title="赔（补）偿费计算依据"></biaotou>
    <inputForm v-model="form" ref="form" :list="list">
    </inputForm>
  </view>
</template>

<script>
import inputForm from "@/components/inputForm.vue";

import Biaotou from "./biaotou.vue";
import {yjgd} from "../../../api/lupeiwenshu";

export default {
  components: {
    Biaotou,
    inputForm,
  },
  data() {
    return {
      form: {
        accordTo:'请各单位前往文书设置进行参数配置'
      },
      list: [
        {
          label: '依据规定：',
          prop: 'accordTo',
          type: 'select',
          props: {
            label: 'name',
            value: 'name'
          },
          dicData: []
        },
      ],
      rules: {
        accordTo: [
          {
            required: true,
            message: "请输入"
          }
        ]
      }
    };
  },
  methods: {
    async initSelectJson() {
      this.list.find(item => item.label === '依据规定：').dicData = (await yjgd()).data;
    },
    setTotal(total) {
      this.form.peichangjine = total;
    },
    submit() {
      this.$refs.form.$refs.form.validate(valid => {
        if (valid) {
          console.log('验证通过');
        } else {
          console.log('验证失败');
        }
      });
    }
  }
  ,
  mounted() {
    this.initSelectJson();
    // this.$refs.form.$refs.form.setRules(this.rules);
  }
  ,

}
;
</script>
